package cn.niit.staticproxy;


import cn.niit.proxy.IHouseRental;
import cn.niit.proxy.OwnerRental;

public class OwnerRentalProxy implements IHouseRental {
    private IHouseRental houseRental=new OwnerRental();
    public OwnerRentalProxy(OwnerRental ownerRental){};

    public void rent() {
        System.out.println("【OwnerRentalProxy.rent开始执行】，看房中");
        if (seeHouse()){
            houseRental.rent();
        }
        System.out.println("【OwnerRentalProxy.rent执行结束】，看房结束");
    }
    public boolean seeHouse(){
        System.out.println("很满意");
        return true;
    }
}
